package com.ziyueyuwen.xiniao.annotation;

import com.ziyueyuwen.xiniao.annotation.validator.ParamValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.NotNull;
import java.lang.annotation.*;

/**
 * @author wancheng  on 2019/1/19.
 */
@Target(ElementType.FIELD)//作用于的类型，此处为对象的属性
@Retention(RetentionPolicy.RUNTIME)//运行时生效
@Constraint(validatedBy = ParamValidator.class)
@Documented
public @interface ParamValidated {

    String name() default "";
    String message() default "";//必填，校验未通过时的提示信息
    Class<?>[] groups() default {};//必填，下文会将到此参数的作用
    Class<? extends Payload>[] payload() default {};//必填
}
